#ifndef __UTL_DEVICE_H__
#define __UTL_DEVICE_H__

#include "fwPlatformContext.h"
#include "..\fwHeader.h"
#include "..\Config\fwdllconfig.h"
#include "..\Game\fwGameContext.h"

class _DLL_LIB_API Device
{
private:
	//Platform Instance
	static PlatformContext * m_pPlatformContext;
	//Device Instance
	static Device * m_pInstance;
public:
	//DeviceID for create platform
	//	Win32: Win32 platform
	//	Android: Android platform
	typedef enum DeviceID{Win32, Android};
private:
	//Constructor, Destructor
	Device();
	~Device();
public:
	/*===========Device handler=============*/
	static Device * GetInstance();
	static void DestroyInstance();

	/*===========Operation of device platform============*/

	//Create a device which run your game 
	//	DeviceID for create platform will run: id
	//		Key: Win32 | Android
	//	Game viewport size: iWidth, iHeight
	//	Game title:	szTitle
	//	Game graphics flags: iFlags (Must be set 0)
	void CreateDevicePlatform(DeviceID id, int iWidth, int iHeight, char* szTitle, int iFlags);

	//Register your game will run in device, it's a implementation of abstract class GameContext
	//	Game will run: pGameContext
	void RegisterGameContext(GameContext* pGameContext);

	//Init data
	int Init();

	//Run device
	void Run();

	//Destroy data
	void Destroy();
};

#endif